package net.citrite.android;

import com.android.ide.common.rendering.api.*;
import com.android.ide.common.resources.ResourceResolver;
import com.android.resources.ResourceType;
import com.android.util.Pair;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class ProjectCallback implements IProjectCallback {
    private ResourceResolver resourceResolver;
    private List<Position> positionList = new ArrayList<>();
    @Override
    public Object loadView(String s, Class[] classes, Object[] objects) throws ClassNotFoundException, Exception {
        return null;
    }

    @Override
    public String getNamespace() {
        return null;
    }

    @Override
    @Deprecated
    public Pair<ResourceType, String> resolveResourceId(int i) {
        return null;
    }

    @Override
    public String resolveResourceId(int[] ints) {
        return null;
    }

    @Override
    public Integer getResourceId(ResourceType resourceType, String s) {
        return null;
    }

    @Override
    @Deprecated
    public ILayoutPullParser getParser(String layoutName) {
        if (resourceResolver != null) {
            ResourceValue value = resourceResolver.getProjectResource(ResourceType.LAYOUT, layoutName);
        }
        return null;
    }

    @Override
    public ILayoutPullParser getParser(ResourceValue resourceValue) {
        return null;
    }

    @Override
    public Object getAdapterItemValue(ResourceReference resourceReference, Object o, ResourceReference resourceReference1, int i, int i1, int i2, int i3, ResourceReference resourceReference2, ViewAttribute viewAttribute, Object o1) {
        return null;
    }

    @Override
    public AdapterBinding getAdapterBinding(ResourceReference resourceReference, Object o, Object o1) {
        return null;
    }

    @Override
    public ActionBarCallback getActionBarCallback() {
        return null;
    }

//    public void updatePosition(int pos, String name) {
//        if (pos <= 0 || name == null || name.isEmpty()) {
//            return;
//        }
//        for (Position position : positionList) {
//            if (position.getEndPos() == pos && position.getLabel().equals(name)) {
//                return;
//            }
//        }
//        Position position = new Position(pos, name);
//        if (!positionList.isEmpty()) {
//            position.setStartPos(positionList.get(positionList.size() - 1).getEndPos());
//        }
//        positionList.add(position);
//    }

//    public Position getPosition(int index) {
//        return positionList.get(index);
//    }
//    public void clearPosition() {
//        positionList.clear();
//    }
}
